package com.example.consumerone.services;

import com.example.consumerone.hystrix.UserServiceHystrix;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@Service
@FeignClient(value = "provider", fallback = UserServiceHystrix.class)
public interface UserService {

    @PostMapping("/user/getCheckCode")
    public String getCheckCode(@RequestParam("userId") String userId);

    @PostMapping("/user/registered")
    public Map<String, Object> registered(@RequestParam(name = "userId") String userId,
                                          @RequestParam(name = "verificatioCode") String verificatioCode);

    @PostMapping("/user/attentionUser")
    public Boolean attentionUser(@RequestParam("userId") String userId, @RequestParam("beNoticedUserId") String beNoticedUserId);

    @PostMapping("/user/reAttentionUser")
    public Boolean reAttentionUser(@RequestParam("userId") String userId, @RequestParam("beNoticedUserId") String beNoticedUserId);

}
